$('.download-mian').on('click', '.download-btn', function() {
  var u = navigator.userAgent
  var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1
  var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
  var ua = u.toLowerCase()
  if (ua.match(/MicroMessenger/i) == 'micromessenger') {
    if (isIOS) {
      location.href =
        'https://itunes.apple.com/cn/app/%E4%B8%87%E6%9E%9C%E7%94%B0%E5%9B%AD/id1316878966?mt=8'
    } else {
      $('.explain').css({ display: 'block' })
    }
  } else if (ua.match(/WeiBo/i) == 'weibo') {
    if (isIOS) {
      $('.explain').css({ display: 'block' })
    } else if (isAndroid) {
      location.href =
        'http://fruit-picture.oss-cn-beijing.aliyuncs.com/fruit/apk/Android/fruit.apk'
    }
  } else {
    if (isAndroid) {
      location.href =
        'http://fruit-picture.oss-cn-beijing.aliyuncs.com/fruit/apk/Android/fruit.apk'
    } else if (isIOS) {
      location.href =
        'https://itunes.apple.com/cn/app/%E4%B8%87%E6%9E%9C%E7%94%B0%E5%9B%AD/id1316878966?mt=8'
    }
  }
})
$('.rs-know-img').click(function() {
  $('.explain').css({ display: 'none' })
})
